package listbyorder.access001_100.test70;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/6/3 21:34
 */
public class Solution2 {

    public int climbStairs(int n) {
        if (n < 2) return 1;
        int pre = 1;
        int next = 1;
        int cur = 0;
        for (int i = 2; i <= n; i++) {
            cur = pre + next;
            pre = next;
            next = cur;
        }
        return cur;
    }
}
